package com.gobo.cmsservice.controller.front;

import com.gobo.cmsservice.pojo.CrmBanner;
import com.gobo.cmsservice.service.CrmBannerService;
import com.gobo.commonutils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/cmsservice/front/banner")
public class BannerController {

    @Autowired
    private CrmBannerService bannerService;

    /**
     * 获取首页指定条数的轮播图数量
     * @param size
     * @return
     */
        @GetMapping("get/{size}")
    public R getBanners(@PathVariable Long size){
        List<CrmBanner> bannerList =  bannerService.getBanners(size);
        return R.ok().data("items",bannerList);
    }

}
